//
//  LSZPublicClassDataToll.m
//  PartyClassCloud
//
//  Created by 梁素珍 on 2018/9/27.
//  Copyright © 2018年 九酷. All rights reserved.
//

#import "LSZPublicClassDataToll.h"

@implementation LSZPublicClassDataToll
#pragma mark - 重复登录
+(void)RepeatLoginInterfaceJump:(UIView *)view fromVC:(NSString *)fromVC
{
    LSZEmptyDataVC * VC = [[LSZEmptyDataVC alloc]init];
    [VC showWithView:view];
    [VC fromWhichInterface:fromVC];
}
#pragma mark - 弹窗
+(void)initWithAlertKuangView:(UIView *)view string:(NSString*)stirng
{
    AlertKuangView * alert = [AlertKuangView new];
    [alert moveJingGaoKuang:stirng :view];
}
#pragma mark - 接受通知返回登录
+(void)initWithAcceptNotificationToReturnToLogin:(id)self_view string:(NSString *)stirng
{
    NSString * strDelete = [NSString stringWithFormat:@"%@Login",stirng];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(goToLogin) name:strDelete object:nil];//删除通知
}
+(void)goToLogin
{
//    NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier];
//    [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain];
    
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    NSDictionary *dic = [userDefaults dictionaryRepresentation];
    for (id  key in dic) {
        if(![NSStr(key) isEqualToString:@"lastPhone"]){
            [userDefaults removeObjectForKey:key];
        }else{
            NSLog(@"%@>>>>>>>23",key);
        }
    }
    [userDefaults synchronize];
    
    [_UserM setLeaf:NullStringjudgment(NSStr(@""))];
    [_UserM setId_id:NullStringjudgment(NSStr(@""))];
    [_UserM setName:NullStringjudgment(NSStr(@""))];
    [_UserM setSummary:NullStringjudgment(NSStr(@""))];
    [_UserM setVillageID:@""];
    [_UserM setVillageIDState:@""];
    [_MyCenter setRealName:@""];
    [_MyCenter setMobilePhone:@""];
    [_MyCenter setBranch_name:@""];
    [_MyCenter setBranch_id:@""];
    [_MyCenter setSex:@""];
    [_MyCenter setDepartmentScore:@""];
    [_MyCenter setHeadUrl:@""];
    [_MyCenter setMyHours:@""];
    [_MyCenter setBranchName:@""];
    UIWindow * window = [UIApplication sharedApplication].delegate.window;
    LSZPasswordLoginVC * vc = [[LSZPasswordLoginVC alloc]init];
    [window setRootViewController:vc];
}
@end
